import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'Layout',
        component: () => import('../layout/index.vue'),
        redirect: '/dashboard',
        children: [
            {
                path: 'dashboard',
                name: 'Dashboard',
                component: () => import('../views/dashboard/index.vue'),
                meta: { title: '仪表盘', icon: 'Odometer' }
            },
            {
                path: 'profile',
                name: 'Profile',
                component: () => import('../views/profile/index.vue'),
                meta: { title: '布布档案', icon: 'User' }
            },
            {
                path: 'schedule',
                name: 'Schedule',
                component: () => import('../views/schedule/index.vue'),
                meta: { title: '布布日程', icon: 'Calendar' },
                children: [
                    {
                        path: 'daily',
                        name: 'Daily',
                        component: () => import('../views/schedule/daily.vue'),
                        meta: { title: '每日安排' }
                    },
                    {
                        path: 'weekly',
                        name: 'Weekly',
                        component: () => import('../views/schedule/weekly.vue'),
                        meta: { title: '周计划' }
                    }
                ]
            },
            {
                path: 'toys',
                name: 'Toys',
                component: () => import('../views/toys/index.vue'),
                meta: { title: '玩具管理', icon: 'Present' },
                children: [
                    {
                        path: 'list',
                        name: 'ToysList',
                        component: () => import('../views/toys/list.vue'),
                        meta: { title: '玩具清单' }
                    },
                    {
                        path: 'favorites',
                        name: 'Favorites',
                        component: () => import('../views/toys/favorites.vue'),
                        meta: { title: '最爱玩具' }
                    }
                ]
            },
            {
                path: 'diet',
                name: 'Diet',
                component: () => import('../views/diet/index.vue'),
                meta: { title: '饮食记录', icon: 'Bowl' },
                children: [
                    {
                        path: 'meals',
                        name: 'Meals',
                        component: () => import('../views/diet/meals.vue'),
                        meta: { title: '营养餐点' }
                    },
                    {
                        path: 'snacks',
                        name: 'Snacks',
                        component: () => import('../views/diet/snacks.vue'),
                        meta: { title: '零食记录' }
                    }
                ]
            },
            {
                path: 'settings',
                name: 'Settings',
                component: () => import('../views/settings/index.vue'),
                meta: { title: '布布设置', icon: 'Setting' }
            }
        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/login/index.vue'),
        meta: { title: '登录' }
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router 